import { HeaderPropsType } from "../props";
import Icon from "@/components/Icon";

const DrawerHeader = (
	props: HeaderPropsType & {
		close?: Fn;
	}
) => {
	return !props.isDetail ? (
		props.title
	) : (
		<div>
			<span className="flex-1">
				{props.showDetailBack && (
					<span onClick={props.close && props.close()}>
						<Icon icon="ant-design:arrow-left-outlined" className="cursor-pointer px-3" />
					</span>
				)}
				{props.title && <span>{props.title}</span>}
			</span>
		</div>
	);
};

export default DrawerHeader;
